<template>
  <div class="base_card_row">
    <span class="base_card_key">{{ title }}</span>
    <span :class="danger ? 'base_card_value danger' : 'base_card_value'">
      <slot />
    </span>
  </div>
</template>

<script>
export default {
  name: 'baseCard',
  props: {
    title: {
      type: String,
      default: ''
    },
    danger: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {}
  },
  created() {},
  mounted() {},
  methods: {}
}
</script>

<style lang="scss" scoped>
.base_card_row {
  margin-bottom: 10px;
  display: flex;

  &:last-of-type {
    margin-bottom: 0;
  }
}

.base_card_key {
  font-family: PingFang SC Regular;
  font-size: 14px;
  font-weight: normal;
  line-height: 24px;
  letter-spacing: 0px;
  color: #656c74;
  width: 84px;
  display: inline-block;
  margin-right: 15px;
  flex-shrink: 0;
  // 强制英文换行
  word-break:break-all;
}

.base_card_value {
  font-family: PingFang SC Regular;
  font-size: 14px;
  font-weight: normal;
  line-height: 24px;
  letter-spacing: 0px;
  color: #171819;

  // 文字省略
  display: inline-block;
  text-overflow: ellipsis;
  overflow: hidden;
  word-break: break-all;
  white-space: nowrap;

  &.danger {
    color: #fe3737;
  }
}
</style>
